<?php 
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$sql="select * from ".tablename('wxc_task')."  where id={$_GPC['id']}";

//$list=pdo_fetch($sql);
$info=pdo_fetch($sql);

//print_r(json_encode($info));die;
if (checksubmit('submit')) {
//    $data['sort'] = $_GPC['sort'];
//	$data['name'] = $_GPC['name'];
//	$data['thumb'] = $_GPC['thumb'];
//	$data['description'] = html_entity_decode($_GPC['description']);
//	$data['link'] = $_GPC['link'];
//	$data['status'] = $_GPC['status'];
//	$data['create_time'] = date('Y-m-d H:i:s',time());
    $data['uniacid']=$_W['uniacid'];
    $data['status']=$_GPC['status'];
	if($_GPC['id']==''){
        $rst=pdo_insert('wxc_task',$data);
        if($rst){
             message('添加成功！', $this->createWebUrl('taskdetails'), 'success');
        }else{
             message('添加失败！','','error');
        }
    }else{
         $rst=pdo_update('wxc_task',$data,array('id'=>$_GPC['id']));
        if($rst){
//            print_r(json_encode($info));die;
             message('编辑成功！', $this->createWebUrl('checktask',array('id'=>$info['order_id'])), 'success');
        }else{
             message('编辑失败！','','error');
        }
    }
}
include $this->template('web/taskdetails');
 ?>